/**
 * @Author       : oak-c
 * @Date         : 2021-01-19 12:29:30
 * @Description  : 队列处理
 * @LastEditors  : oak-c
 * @LastEditTime : 2021-01-21 22:59:50
 * @FilePath     : /src/service/global/queue.service.ts
 */
import { CustomLoggerService } from '@/modules'
import { Injectable } from '@nestjs/common'
import { Job } from 'bull'
import { EventConsumer } from 'nestjs-queue'
// import { FireService } from '../fire/fire.service'

@Injectable()
export class GlobalQueueService {
    constructor(private readonly logger: CustomLoggerService) {}

    @EventConsumer('onenet')
    public async eventHandler(job: Job) {
        this.logger.info(`[QueueService] #执行队列任务 - ONENET - ID:${job.id}`)
        try {
            // await this.fireService.doOneNet(job.data)
        } catch (e) {
            this.logger.error(e)
            throw e
        }
    }
}
